package com.yael.tables;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class NP_PROCESS implements Serializable {

	@Persistent
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long processID;
	
	@Persistent(mappedBy="process")
	private List<NP_PROCESS_STATE> states = new ArrayList<NP_PROCESS_STATE>();
	

//	 public NP_PROCESS_STATE store(PersistenceManager pm, CacheManagerService cm) {
//		 NP_PROCESS_STATE network = null;
//	        try {
//	        	network = pm.makePersistent(this);
//	        	this.networkID = network.getNetworkID();
//	        	cm.setValue(Long.toString(this.networkID), this);
//	        } finally {
//	            pm.close();
//	        }
//	        return this;
//	 }
//	 
//	 public static NP_NETWORK_IDENTITY retriveByID(PersistenceManager pm, CacheManagerService cs, String messageID){
//		 Object object = null;
//		 object = cs.getValue(messageID);
//		 if(object!=null) {
//			 object = Datastore.retriveByID(pm, NP_NETWORK_IDENTITY.class, Long.parseLong(messageID));
//			 cs.setValue(messageID, object);
//		 }
//		 if(object!=null) return (NP_NETWORK_IDENTITY) object;
//		 return null;
//	 }
}

